<?php

namespace app\models\jasper;

/**
 * 自定义Soap客户端
 * Class SoapClient
 * @package app\models\jasper
 */
class SoapClient extends \SoapClient
{
    /**
     * @inheritdoc
     */
    public function __doRequest($request, $location, $action, $version, $one_way = 0)
    {
        // 由于服务器只能识别头部中namespace名称为wsse，所以这里需要全部替换一遍
        $request = preg_replace('/\bns2\b/', 'wsse', $request);
        return parent::__doRequest($request, $location, $action, $version, $one_way);
    }
}
